class School(object):
    """学校"""

    def __init__(self, name, age, id, sex):
        self.name = name
        self.age = age
        self.id = id
        self.sex = sex
        print(f"初始化 School：{self.name}")

    def tell(self):
        """打印细节"""
        print(f"姓名：{self.name}\t年龄：{self.age}\t性别：{self.sex}\tID：{self.id}", end="\t")


class Teacher(School):
    """表示老师"""

    def __init__(self, name, age, salary, id, sex):
        School.__init__(self, name, age, id, sex)
        self.salary = salary
        print(f"初始化 Teacher：{self.name}")

    def tell(self):
        School.tell(self)  # 显式调用，传递 self
        print(f"工资：{self.salary}")


class Student(School):
    """学生"""

    def __init__(self, name, age, marks, id, sex):
        super().__init__(name, age, id, sex)  # 通过 super() 调用父类的初始化方法
        self.marks = marks
        print(f"初始化 Student：{self.name}")

    def tell(self):
        super().tell()
        print(f"成绩：{self.marks}")


t = Teacher("刘老师", 40, 500, 'A001', '男')
t.tell()
s = Student("张三", 20, 86, 'A002', '女')
s.tell()
